package cn.b.sky.schedule.config;

import org.quartz.Scheduler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

/**
 * @Author: yueding
 * @Description:
 * @Date: Created in 17:01 2017/11/6
 * @Modified By:
 * Copyright(c) cai-inc.com
 */
@Configuration
public class ScheduleConfig {

    @Bean
    public Scheduler scheduler() {
        SchedulerFactoryBean scheduler = new SchedulerFactoryBean();
        scheduler.setAutoStartup(Boolean.TRUE);
        return scheduler.getObject();
    }

}
